#!/usr/bin/env bash
cmd="$1"
echo "$cmd" | tee -a "${2:-/dev/null}"
eval "$cmd"
